<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>阳曲服务区信息平台</title>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrap.min.css">
  <link rel="stylesheet" href="${request.contextPath}/statics/css/font-awesome.min.css">
  <link rel="stylesheet" href="${request.contextPath}/statics/css/AdminLTE.min.css">
  <link rel="stylesheet" href="${request.contextPath}/statics/css/all-skins.min.css">
  <link rel="stylesheet" href="${request.contextPath}/statics/css/main.css">
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <style type="text/css">
        .login-box-body, .register-box-body {
            background: url(../../statics/css/img/kuang.png);
            padding: 290px;
            border-top: 0;
            color: #fff;
        }

        .login-page, .register-page {
            background: url(../../statics/css/img/aa.png) no-repeat;
            float: hidden;
        }

        .login-box, .register-box {
            width: 1015.67px;
            position: relative;
            /* top: 100%; */
            left: 23.6%;
            margin: 0;
        }

    </style>
</head>

<body class="hold-transition login-page" onload="load();">
<div style="padding: 30px 0px 100px 30px;" ><img src="../../statics/css/img/logo.png" style="width: 12%;"></div>
<div class="login-box" id="rrapp" v-cloak>

    <!-- /.login-logo -->
    <div class="login-box-body" >

        <p class="login-box-msg" style="position: absolute; right: 0%;font-size: 38px;top:30px; color: #4f4f4f;font-weight: bold;display: inline-block;
	  width: 48.4%;text-align:center;">阳曲服务区信息集成平台</p>
        <p class="login-box-msg" style="position: absolute; right: 0%;font-size:28px;top:150px; color: #3C8DBC;font-weight:normal;letter-spacing:8px;display: inline-block;
	 width: 48.4%;text-align:center;">登录</p>

        <div class="form-group has-feedback" style="position: absolute; top:250px;right:10%;">
            <input type="text" class="form-control" v-model="username" placeholder="账号" style="width: 268px;border: 0px; border-bottom:1px solid #385072 ;">
            <span class="glyphicon glyphicon-user form-control-feedback"></span>
        </div>
        <div class="form-group has-feedback"  style="position: absolute; top:315px;right:10%;">
            <input type="password" class="form-control" v-model="password" placeholder="密码" style="width: 268px;border: 0px; border-bottom:1px solid #385072 ;">
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
        </div>

        <div v-if="error" class="alert alert-danger alert-dismissible"style="position: absolute; top:380px;right:12%;">
            <h4 style="margin-bottom: 0px;"><i class="fa fa-exclamation-triangle"></i> {{errorMsg}}</h4>
        </div>
        <!--<div class="form-group has-feedback">
          <input type="text" class="form-control" v-model="captcha" @keyup.enter="login" placeholder="验证码">
          <span class="glyphicon glyphicon-warning-sign form-control-feedback"></span>
        </div>
        <div class="form-group has-feedback">
          <img alt="如果看不清楚，请单击图片刷新！" class="pointer" :static/picture/b14354ba9b6843e9bb94fc6b4861f89c.gif="src" @click="refreshCode">
          &nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" @click="refreshCode">点击刷新</a>
        </div>-->


        <div class="row"style="position: absolute; top:425px;right:29.3%;border: none">
            <!-- /.col -->
            <div class="col-xs-4" >
                <button type="button" class="btn btn-primary btn-block btn-flat" @click="login"style="width:270px; height: 38px;border-radius:10px;letter-spacing:4px;position:absolute;left: -138%" >登录</button>
            </div>
            <!-- /.col -->
        </div>
        <!-- /.social-auth-links -->

    </div>

    <!-- /.login-box-body -->
</div>
<!-- /.login-box -->
<script src="${request.contextPath}/statics/libs/jquery.min.js"></script>
<script src="${request.contextPath}/statics/libs/vue.min.js"></script>
<script src="${request.contextPath}/statics/libs/bootstrap.min.js"></script>
<script src="${request.contextPath}/statics/libs/jquery.slimscroll.min.js"></script>
<script src="${request.contextPath}/statics/libs/fastclick.min.js"></script>
<script src="${request.contextPath}/statics/libs/app.js"></script>
<script src="${request.contextPath}/statics/plugins/layer/layer.js"></script>
<script type="text/javascript">
var vm = new Vue({
	el:'#rrapp',
	data:{
		username: '',
		password: '',
		captcha: '',
		error: false,
		errorMsg: '',
		src: 'captcha.jpg'
	},
	beforeCreate: function(){
		if(self != top){
			top.location.href = self.location.href;
		}
	},
	methods: {
		refreshCode: function(){
			this.src = "captcha.jpg?t=" + $.now();
		},
		login: function (event) {
			var data = "username="+vm.username+"&password="+vm.password+"&captcha="+vm.captcha;
			$.ajax({
				type: "POST",
			    url: "sys/login",
			    data: data,
			    dataType: "json",
			    success: function(result){
					if(result.code == 0){//登录成功
						//parent.location.href ='indexs.html';
						parent.location.href ='../../modules/page/page_1.html';
						//parent.location.href ='page_1.html';
					}else{
						vm.error = true;
						vm.errorMsg = result.msg;
						
						vm.refreshCode();
					}
				}
			});
		}
	}
});

$(document).keyup(function (e) {//捕获文档对象的按键弹起事件
    if (e.keyCode == 13) {//按键信息对象以参数的形式传递进来了
        vm.login();
    }
});
</script>
<script>
    function load() {
        $.get("authorize/checkLicence", function(r){
            if(r.result == 1){
                layer.open({
                    closeBtn: 0
                    ,title: '警告'
                    ,content: '系统授权已过期！',
                    //time:2900,
                    yes:function(index,layero){
                        window.location.href='licence.html';
                    }
                });
                window.setTimeout("window.location.href='licence.html'",5000);
            }else if(r.result == 2){
                layer.open({
                    closeBtn: 0
                    ,title: '警告'
                    ,content: '系统未授权！',
                    //time:2900,
                    yes:function(index,layero){
                        window.location.href='licence.html';
                    }
                });
                window.setTimeout("window.location.href='licence.html'",5000);
            }
        });
    }
</script>
</body>
</html>
